
open Random
open Array ;;

type probabilityDistribution
    = ConstantPD of float |
      UniformPD of float * float (* min, max *)
(*
      NormalPD of float * float | (* mean, sd *)
      LogNormalPD of float * float | (* ditto *)
      IntRoundPD of probabilityDistribution | (* ditto *)
*)

let getDNum = function
  | ConstantPD n -> n
  | UniformPD (lo,hia) -> (Random.float (hia -. lo)) +. lo

let swap a i j =
  let t = a.(i) in
  a.(i) <- a.(j);
  a.(j) <- t

let shuffle al =
  let ax = Array.of_list al in
  (Array.iteri (fun i _ -> swap ax i (Random.int(Array.length ax))) ax) ;
  Array.to_list ax 



(*
let randRange = 

*)
